﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 新增打包台 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_BindPickingPosition");

            migrationBuilder.DropTable(
                name: "T_FacilityTwin");

            migrationBuilder.DropTable(
                name: "T_PickingPosition");

            migrationBuilder.CreateTable(
                name: "T_CachePort",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    AreaType = table.Column<int>(type: "int", nullable: true),
                    WorkMode = table.Column<int>(type: "int", nullable: true),
                    IsUsed = table.Column<bool>(type: "bit", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderStatus = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderId = table.Column<long>(type: "bigint", nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    RelatedOrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_CachePort", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Pack",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    AreaType = table.Column<int>(type: "int", nullable: true),
                    IsUsed = table.Column<bool>(type: "bit", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderStatus = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderId = table.Column<long>(type: "bigint", nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    RelatedOrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Pack", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_CachePort");

            migrationBuilder.DropTable(
                name: "T_Pack");

            migrationBuilder.CreateTable(
                name: "T_BindPickingPosition",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    NowLoginUserId = table.Column<long>(type: "bigint", nullable: true),
                    NowLoginUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PickingPositionCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    PickingPositionId = table.Column<long>(type: "bigint", nullable: true),
                    PickingPositonName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_BindPickingPosition", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_FacilityTwin",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    StackerTag = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    currentPoint = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    endPoint = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    startPoint = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    taskCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    taskType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_FacilityTwin", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PickingPosition",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PickingPositionCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    PickingPositionId = table.Column<long>(type: "bigint", nullable: true),
                    PickingPositionName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PickingPosition", x => x.Id);
                });
        }
    }
}
